package org.example;

import org.example.enums.EndpointEnum;
import org.example.plugin.HeartBeat;
import org.example.processor.MyProcessor;
import org.example.protocol.StringProtocol;
import org.smartboot.socket.extension.plugins.StreamMonitorPlugin;
import org.smartboot.socket.transport.AioQuickServer;

import java.io.IOException;

/**
 * @author TBD
 */
public class Server {
    public static void main(String[] args) throws IOException {
        MyProcessor myProcessor = new MyProcessor(EndpointEnum.SERVER);
        myProcessor.addPlugin(new HeartBeat());
        // myProcessor.addPlugin(new StreamMonitorPlugin<>());
        AioQuickServer aioQuickServer = new AioQuickServer(8888,new StringProtocol(), myProcessor);
        aioQuickServer.start();
    }
}